package com.lx.yygh.oos.controller;

import com.lx.yygh.common.result.Result;
import com.lx.yygh.oos.service.FileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * @author c先生
 * @date 2022年10月25日 下午 3:10:17
 * @describe
 */
@Api(tags = "阿里云OSS文件上传")
@RestController
@RequestMapping("/api/oss/file/")
public class FileApiController {

    @Resource
    FileService fileService;

    @ApiOperation(value = "文件上传")
    @PostMapping("/fileUpload")
    public Result fileUpload(MultipartFile file){
        String url = fileService.fileUpload(file);
        return Result.ok(url);
    }
}
